﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TecBaseObjects.Objects;
using TecData.Layer;

namespace TecData.Manager {

    public class TimerFileDataManager {

        #region Members
        #endregion

        #region Load

        public static TimerFileObj LoadTecUser(string fileName, int userID) {
            using (TimerFileDataLayer dl = CreateTimerFileDataLayer()) {
                return dl.LoadTimerFile(fileName, userID);
            }
        }

        public static List<TimerFileObj> LoadTimerFilesByUser(int userID) {
            using (TimerFileDataLayer dl = CreateTimerFileDataLayer()) {
                return dl.LoadTimerFilesByUser(userID);
            }
        }

        #endregion

        #region Save

        public static void RemoveTimerFileObj(string fileName, int userID) {
            using (TimerFileDataLayer dl = CreateTimerFileDataLayer()) {
                dl.RemoveTimerFile(fileName, userID);
            }
        }

        public static void SaveTimerFileObj(TimerFileObj tf) {
            using (TimerFileDataLayer dl = CreateTimerFileDataLayer()) {
                dl.SaveTimerFile(tf);
            }
        }

        #endregion

        #region Functions

        
        private static TimerFileDataLayer CreateTimerFileDataLayer() {
            return (DataManager.CreateDataLayer(typeof(TimerFileDataLayer)) as TimerFileDataLayer);
        }

        #endregion

    }
}
